import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [
  {
    path: '/',
    redirect:"/index"
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import('../views/Index.vue')
  },
  {
    path: '/businessList/:typeId',
    name: 'BusinessList',
    component: () => import('../views/BusinessList.vue')
  },

  {
    path: '/businessInfo/:businessId',
    name: 'BusinessInfo',
    component: () => import('../views/BusinessInfo.vue')
  },
  {
    path: '/order/:orderId',
    name: 'Order',
    component: () => import('../views/Order.vue')
  },
  {
    path: '/payment/:orderId',
    name: 'Payment',
    component: () => import('../views/Payment.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/Register.vue')
  },
]

// 创建router实例
const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router // 导出router
